package com.mrd.modules.generator.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mrd.base.utils.StringUtils;
import com.mrd.modules.generator.dao.CodegenColumnDao;
import com.mrd.modules.generator.entity.CodegenColumnEntity;
import com.mrd.modules.generator.service.CodegenColumnService;

@Service("codegenColumnService")
public class CodegenColumnServiceImpl implements CodegenColumnService {
	@Autowired
	private CodegenColumnDao codegenColumnDao;
	
	@Override
	public CodegenColumnEntity queryObject(String id){
		return codegenColumnDao.queryObject(id);
	}
	
	@Override
	public List<CodegenColumnEntity> queryList(Map<String, Object> map){
		return codegenColumnDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return codegenColumnDao.queryTotal(map);
	}
	
	@Override
	public void save(CodegenColumnEntity codegenColumn){
		if(StringUtils.isEmpty(codegenColumn.getId()))
			codegenColumn.setId(StringUtils.randomUUID());
		codegenColumnDao.save(codegenColumn);
	}
	
	@Override
	public void update(CodegenColumnEntity codegenColumn){
		codegenColumnDao.update(codegenColumn);
	}
	
	@Override
	public void delete(String id){
		codegenColumnDao.delete(id);
	}
	
	@Override
	public void deleteBatch(String[] ids){
		codegenColumnDao.deleteBatch(ids);
	}
	
}
